package com.woniu.liuzhougov.relatedinformation.controller;

import com.woniu.liuzhougov.businessproject.vo.Result;
import com.woniu.liuzhougov.relatedinformation.pojo.GoodEnterprise;
import com.woniu.liuzhougov.relatedinformation.pojo.RelatedInformation;
import com.woniu.liuzhougov.relatedinformation.service.RelatedInformationService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.List;

public interface RelatedInformationController<T> {

    //查找所有内容
    Result list();

    //根据名称模糊查询
    Result search(String name);

    //根据ID删除
    Result delete(@RequestParam(value = "deletelist[]") Integer[] deletelist);

    //添加
    Result add(T t);

    //修改信息
    Result update(T t);

    //初始化修改表单
    Result initForm(Integer id);

    //上传文件
    com.woniu.liuzhougov.common.utils.Result upload(MultipartFile file, HttpServletRequest request) throws IOException, IllegalStateException;

    //更新上传后的数据
    com.woniu.liuzhougov.common.utils.Result addFile(RelatedInformation fileData);

}